package com.medical.literature.document.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 文献实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("literature")
public class Literature {
    
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 文献标题
     */
    @NotBlank(message = "文献标题不能为空")
    @Size(max = 200, message = "文献标题长度不能超过200个字符")
    private String title;

    /**
     * 作者信息
     */
    @Size(max = 500, message = "作者信息长度不能超过500个字符")
    private String authors;

    /**
     * 摘要
     */
    @TableField("abstract")
    @Size(max = 2000, message = "摘要长度不能超过2000个字符")
    private String abstractText;

    /**
     * 关键词（逗号分隔）
     */
    @Size(max = 500, message = "关键词长度不能超过500个字符")
    private String keywords;

    /**
     * 期刊名称
     */
    @Size(max = 100, message = "期刊名称长度不能超过100个字符")
    private String journal;

    /**
     * 发表日期
     */
    private LocalDate publicationDate;

    /**
     * DOI号
     */
    @Size(max = 100, message = "DOI号长度不能超过100个字符")
    private String doi;

    /**
     * 文件存储路径
     */
    @NotBlank(message = "文件存储路径不能为空")
    private String fileUrl;

    /**
     * 原始文件名
     */
    @NotBlank(message = "原始文件名不能为空")
    private String fileName;

    /**
     * 文件大小（字节）
     */
    @NotNull(message = "文件大小不能为空")
    private Long fileSize;

    /**
     * 文件类型
     */
    @NotBlank(message = "文件类型不能为空")
    private String fileType;

    /**
     * 状态：0-已删除，1-正常，2-处理中
     */
    @NotNull(message = "状态不能为空")
    private Integer status;

    /**
     * 识别状态：0-未识别，1-识别中，2-已识别，3-识别失败
     */
    @NotNull(message = "识别状态不能为空")
    private Integer recognitionStatus;

    /**
     * 上传用户ID
     */
    @NotNull(message = "上传用户ID不能为空")
    private Long uploadUserId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    
    // 手动添加getter/setter方法，确保Lombok注解生效
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getAuthors() {
        return authors;
    }
    
    public void setAuthors(String authors) {
        this.authors = authors;
    }
    
    public String getAbstractText() {
        return abstractText;
    }
    
    public void setAbstractText(String abstractText) {
        this.abstractText = abstractText;
    }
    
    public String getKeywords() {
        return keywords;
    }
    
    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }
    
    public String getJournal() {
        return journal;
    }
    
    public void setJournal(String journal) {
        this.journal = journal;
    }
    
    public LocalDate getPublicationDate() {
        return publicationDate;
    }
    
    public void setPublicationDate(LocalDate publicationDate) {
        this.publicationDate = publicationDate;
    }
    
    public String getDoi() {
        return doi;
    }
    
    public void setDoi(String doi) {
        this.doi = doi;
    }
    
    public String getFileUrl() {
        return fileUrl;
    }
    
    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }
    
    public String getFileName() {
        return fileName;
    }
    
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }
    
    public Long getFileSize() {
        return fileSize;
    }
    
    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }
    
    public String getFileType() {
        return fileType;
    }
    
    public void setFileType(String fileType) {
        this.fileType = fileType;
    }
    
    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public Integer getRecognitionStatus() {
        return recognitionStatus;
    }
    
    public void setRecognitionStatus(Integer recognitionStatus) {
        this.recognitionStatus = recognitionStatus;
    }
    
    public Long getUploadUserId() {
        return uploadUserId;
    }
    
    public void setUploadUserId(Long uploadUserId) {
        this.uploadUserId = uploadUserId;
    }
    
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
}